< previous page page_269 next page >

Page 269
e10a6a0a59f035e870d90cca05b85fce.gif
        ' Wait for the next frame's time.
        next_time = next_time + ms_per_frame
        WaitTill next_time
    Next chunk

    ' Finish up.
    pic_old.Picture = pic_new.Picture
End Sub
Program Scenes also displays tiles spiraling inward or spiraling outward. The differences between these routines are in how they order the tiles' row and column values in the chunk_row and chunk_col arrays. After they have ordered the tiles, they all use the DisplayTiles subroutine to display the results.
Dissolves and Fades
In a dissolve, the old image gradually blends into the new one. The old image gradually grows darker while the new image gradually grows lighter. Eventually, the new image is completely displayed, and the old image is gone.
Example program Dissolve demonstrates this technique. The following code shows how the program works. For each frame in the dissolve sequence, the program combines appropriate fractions of the pixel values in the two images. For example, one-quarter of the way through the animation sequence, the program uses three-quarters of the first image's pixel values plus one-quarter of the second image's values.
e10a6a0a59f035e870d90cca05b85fce.gif
' Make the fade frames.
Private Sub cmdDissolve_Click()
Dim num_frames As Integer
Dim base_name As String
Dim pic0_pixels() As RGBTriplet
Dim pic1_pixels() As RGBTriplet
Dim new_pixels() As RGBTriplet
Dim bits_per_pixel As Integer
Dim X As Integer
Dim Y As Integer
Dim i As Integer
Dim f0 As Single
Dim f1 As Single

    If Not IsNumeric(txtNumFrames.Text) Then -
        txtNumFrames.Text = "10"
    num_frames = CInt(txtNumFrames.Text)
    base_name = txtBaseName.Text

    ' Get the input pixels.
    GetBitmapPixels picCanvas(0), pic0_pixels, bits_per_pixel
    GetBitmapPixels picCanvas(1), pic1_pixels, bits_per_pixel

 
< previous page page_269 next page >